//
// Created by denglibin on 2021/5/31.
//

#ifndef SDL_DEMO_TETRIS_SPIRIT_H
#define SDL_DEMO_TETRIS_SPIRIT_H
enum ShapeType{
    O = 1, I = 2,
    S = 3, Z = 4,
    L = 5, J = 6,
    T = 7
};
typedef struct tetris_spirit{
    int x, y;
    int x_direction;
    int flags[4][4];
    enum ShapeType type;
}TetrisSpirit;
/**
 * 创建一个随机类型的形状
 * @return
 */
TetrisSpirit* TetrisSpiritCreteRandomType();



/**
 * 类型转换
 * @param tetrisSpirit
 * @param type
 */
void TetrisSpiritTransformTo(TetrisSpirit* tetrisSpirit, enum ShapeType type);

/**
 * 顺时针旋转90度
 * @param tetrisSpirit
 */
void TetrisSpiritRotate(TetrisSpirit* tetrisSpirit);

/**
 * 释放
 * @param tetrisSpirit
 */
void TetrisSpiritFree(TetrisSpirit* tetrisSpirit);
#endif //SDL_DEMO_TETRIS_SPIRIT_H
